{% extends "layout.html" %}

{% block body %}


<div class="card" style="width: 55rem;margin: 10px auto 0;border-width: 0">

    <form method="post">
        <div class="mb-3">
            <label for="exampleFormControlInput1" class="form-label">Name</label>
            <input type="text" name="name" class="form-control" id="exampleFormControlInput1" placeholder="name">
        </div>
        <div class="mb-3">
            <label for="exampleFormControlTextarea1" class="form-label">Message</label>
            <textarea class="form-control" name="textarea" id="exampleFormControlTextarea1" rows="4"></textarea>
        </div>
        <input type="submit" class="btn btn-primary" value="Submit"
               style="border-radius: 8px;width: 80px;margin-bottom: 30px">
    </form>


    <div class="d-flex justify-content-between align-items-end" style="margin-bottom: 10px">
        <label for="exampleFormControlInput1" style="font-size: 25px">{{ messages|length }} messages</label>
        <!--label for="exampleFormControlInput1" style="font-size: 15px">下载 &nbsp;&nbsp;</label-->
        <a href="#">
            <img src="/static/icon/download.svg" alt="logo" width="25" class="custom-margin" style="margin-right: 10px">
        </a>


    </div>
    <!--label for="exampleFormControlInput1" class="form-label" style="font-size: 25px">3 messages</label-->

    <!--label for="exampleFormControlInput1" class="form-label" style="font-size: 25px;text-align: right">下载</label-->


    <div class="list-group">
        {% for item in messages %}
        <a href="#" class="list-group-item list-group-item-action" aria-current="true">
            <div class="d-flex w-100 justify-content-between">
                <h5 class="mb-1">{{ item.name }} &nbsp; #{{ item.id }}</h5>
                <small>{{ item.timestamp }}</small>
            </div>
            <p class="mb-1" style="margin-top: 10px">{{ item.body }}</p>
            <!--small>And some small print.</small-->
        </a>
        {% endfor %}

    </div>

</div>


{% endblock %}